//
//  ZCmainCell.m
//  zctx
//
//  Created by Yi luqi on 15/10/7.
//  Copyright © 2015年 sanliang. All rights reserved.
//

#import "ZCInvolvedCell.h"
#import "ZCMainModel.h"

@implementation ZCInvolvedCell

- (void)awakeFromNib {
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
  
    self.progreesView.roundedCorners = YES;
    self.progreesView.trackTintColor = [UIColor colorWithHexString:@"#81d5ce"];
    self.progreesView.progressTintColor = [UIColor colorWithHexString:@"#03ab9e"];
    self.stateLable.textColor = [UIColor colorWithHexString:@"#03ab9e"];
    
}

-(void)setMainModel:(ZCMainModel *)mainModel{
    
    _mainModel = mainModel;
    
    self.nameLable.text =[NSString stringWithFormat:@"%@",_mainModel.pjname];
    self.locationLable.text = [NSString stringWithFormat:@"%@",_mainModel.location];
    self.institutionLable.text = [NSString stringWithFormat:@"%@",_mainModel.institution];
    NSURL *url =[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",[NetworkManager strURLBasic],_mainModel.thumb]];
    [self.ImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"placeholderImg"]];
    
    float priceStr = [[NSString stringWithFormat:@"%@",_mainModel.finish]floatValue];
    float money = [[NSString stringWithFormat:@"%@",_mainModel.emoney]floatValue];
    
    float finlishInt = priceStr/money;
    if (finlishInt>=1) {
        finlishInt = 1;
    }
    
    self.progreesView.progress = finlishInt;
    self.progreesView.progressLabel.text = [NSString stringWithFormat:@"%.0f%@",finlishInt*100,@"%"];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
